package org.xyl.engine;

import dev.langchain4j.store.embedding.EmbeddingStore;
import dev.langchain4j.store.embedding.chroma.ChromaEmbeddingStore;

import java.time.Duration;

public class ChromaInitializer {


    public static EmbeddingStore initializeChroma() {
        // 默认连接到本地 Chroma 服务器 (http://localhost:8000)
        EmbeddingStore embeddingStore = ChromaEmbeddingStore.builder()
                .baseUrl("http://127.0.0.1:8000")
                .timeout(Duration.ofDays(1))// Chroma 服务器地址
                .collectionName("my_collection")  // 集合名称
                .build();

        return embeddingStore;
    }
}